package com.aabte.design2.behavioral.observer;

/**
 * @author Daniel
 * @version 1.0
 * @date 2020/5/4
 */
public class Editor {

    private EventManager eventManager;
    private String path;

    public void openFile(String path) {
        this.path = path;
        eventManager.eventNotify("open", path);
    }

    public void saveFile() {
        eventManager.eventNotify("save", this.path);
    }

    public void setEventManager(EventManager eventManager) {
        this.eventManager = eventManager;
    }
}
